#!/usr/bin/env python
#coding=utf-8

import aocbase
class Aoc(aocbase.AocBase):
    "Aoc_s 用于查询"
    def param_check(self):
        "检查参数列表"
        return True
    
    def aoc_parse(self):
        "将该AOC分解为DOC"
        # 查询所有记录
        if self.params and (self.params[0] == 'all'):
            self.doclist.append(['select', self.params])
        else:
            self.doclist.append(['select', self.params])

    def excute_doc(self):
        "执行该AOC对应的DOC"
        # 该AOC需要输出返回信息
        if self.doclist:
            print '\n\n查询开始'
            for tdoc in self.doclist:
                l = self.doc.excute_doc_func(tdoc[0], tdoc[1])
                for i in l:
                    print '>>'
                    s = '  '
                    for j in i:
                        s += '%s:%s ' % (str(j[0]), str(j[1]))
                    print s
        print '查询完成'
